﻿@{
    ViewBag.Title = "Danh sách Thùng";
}
<script type="text/javascript">
    $(document).ready(function() {
        new SearchHelper($("#txtSearch"), $("#btnSearch"), $("#Region"));
    });
</script>
<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Areas/Administrator/Content/Images/ico-catalog.png")" alt="" />
        Danh sách Thùng
    </div>
    <div class="options">
        <a href="@Url.Action("Create", "Region")" class="t-button">Tạo mới</a>
    </div>
</div>
@Helpers.SearchPanel(text: "Nhập vào từ khóa tìm kiếm...", btnSearch: "btnSearch", txtSearch: "txtSearch")
@Html.Osd().HiddenPopupWindow("Cảnh Báo", Helpers.DeleteConfirmMessageBox("Bạn có thực sự muốn xóa không", @Url.Action("delete", "Region", new { area = "administrator" })).ToHtmlString())

@(Html.Telerik().Grid<Transport.Areas.Administrator.Models.RegionModel>()
        .Name("Region")
    .Columns(columns =>
    {
        columns.Bound(x => x.RegionId).Title("MS").ClientTemplate("<label><#= 10000 + RegionId #></label>")
                            .Width(200)
                            .Filterable(false);
        columns.Bound(x => x.RegionName).Title("Tên Thùng")
            .Filterable(false);
        columns.Bound(p => p.RegionId)
            .ClientTemplate("<a href=" + Url.Action("PackagingByRegion", "Parcel") + "/<#= RegionId #>><img width='24px' title=\"Đóng gói - Chuyển tiếp\" src=\"" + Url.Content("~/Content/images/package.png") + "\" /></a>")
            .HtmlAttributes(new { style = "text-align:center" })
            .Title(string.Empty)
            .Width(60).Sortable(false)
            .Filterable(false);
    }).Sortable(p => p.OrderBy(o => o.Add(b => b.RegionId).Descending()))
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("PackagingGridModel", "Parcel"))
    .Pageable()
    .Scrollable(scrolling => scrolling.Height(400))
    .Groupable(grouping => grouping.Enabled(false))
    .Filterable()) 